#################################################################
## Mod Title:   Signature Editor/Preview Deluxe ;)
## Author:   EGO2000
## Description: This mod adds a really cool Signature Editor to
##      your Board, included Preview & Save & BBCodes
##
## Installation Level:   Very Easy
## Installation Time:   2-5 Minutes
##
##Spanish Traslation Morph  http://www.pc-morph.com/
##Dowload mod Prove in phpbb 2.0.21 October/2006
##
##
## Files To Edit:   4
##      * profile.php
##      * language/xxx/lang_main.php
##      * includes/usercp_register.php
##      * templates/xxx/profil_add_body.tpl
##           
## Included Files:   2
##      * includes/usercp_signature.php
##      * templates/xxx/profil_signature.tpl
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All
## Files Related To This MOD
#################################################################

#
#-----[ UPLOAD ]------------------------------------------
#
usercp_signature.php => /phpBB/includes
profil_signature.tpl => /phpBB/templates/xxx

#
#-----[ OPEN ]---------------------------------------------
#
profile.php

#
#-----[ FIND ]---------------------------------------------
#
      include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
      exit;
   }

#
#-----[ AFTER, ADD ]--------------------------------------
# phpBB 2.0.4 only !!!

   else if ( $mode == 'signature' )
   {
      if ( !$userdata['session_logged_in'] && $mode == 'signature' )
      {
         redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=signature", true));
      }

      include($phpbb_root_path . 'includes/usercp_signature.'.$phpEx);
      exit;
   }

#
#-----[ AFTER, ADD ]--------------------------------------
# phpBB 2.0.x !!!

   else if ( $mode == 'signature' )
   {
      if ( !$userdata['session_logged_in'] && $mode == 'signature' )
      {
         $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: ";
         header($header_location . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=signature", true));
         exit;
      }

      include($phpbb_root_path . 'includes/usercp_signature.'.$phpEx);
      exit;
   }

#-----[ AFTER, ADD ]--------------------------------------
# phpBB 2.0.21 October 2006.x !!! Prove in forum Morph OK

else if ( $mode == 'signature' )
	{
		if ( !$userdata['session_logged_in'] && $mode == 'signature' )
		{
			redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=signature", true));
		}

		include($phpbb_root_path . 'includes/usercp_signature.'.$phpEx);
		exit;
	}


#
#-----[ OPEN ]---------------------------------------------
#
language/lang_english/lang_main.php

#
#-----[ FIND ]---------------------------------------------
#

//
// That's all Folks!
// -------------------------------------------------

?>

#
#-----[ BEFORE, ADD ]--------------------------------------
#
//signature editor
$lang['sig_description'] = "Edit Signature (<b>Preview included</b>)";
$lang['sig_edit'] = "Edit Signature";
$lang['sig_current'] = "Current Signature";
$lang['sig_none'] = "No Signature available";
$lang['sig_save'] = "Save";
$lang['sig_save_message'] = "Signature saved successful !";


#
#-----[ OPEN ]---------------------------------------------
#
language/lang_spanish/lang_main.php

#
#-----[ FIND ]---------------------------------------------
#

//
// That's all Folks!
// -------------------------------------------------

#
#-----[ BEFORE, ADD ]--------------------------------------
#

//signature editor
$lang['sig_description'] = "Editar Firma (<b>Con Vista Previa Incluida</b>)";
$lang['sig_edit'] = "Editar Firma";
$lang['sig_current'] = "Firma Actual";
$lang['sig_none'] = "Sin Firma disponible";
$lang['sig_save'] = "Guardar";
$lang['sig_save_message'] = "Firma Guardada!";


#
#-----[ OPEN ]---------------------------------------------
#
language/lang_german/lang_main.php

#
#-----[ FIND ]---------------------------------------------
#

//
// That's all Folks!
// -------------------------------------------------

?>

#
#-----[ BEFORE, ADD ]--------------------------------------
#
//signature editor
$lang['sig_description'] = "Signatur bearbeiten (<b>inklusive Vorschau</b>)";
$lang['sig_edit'] = "Signatur bearbeiten";
$lang['sig_current'] = "Aktuelle Signatur";
$lang['sig_none'] = "Keine Signatur vorhanden";
$lang['sig_save'] = "Speichern";
$lang['sig_save_message'] = "Signatur erfolgreich gespeichert !";

#
#-----[ OPEN ]---------------------------------------------
#
includes/usercp_register.php

#
#-----[ FIND ]---------------------------------------------
#
         $sql = "UPDATE " . USERS_TABLE . "
            SET " . $username_sql . $passwd_sql .

#
#-----[ IN LINE FIND & REMOVE ]---------------------------------------------
#
, user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid'

#
#-----[ FIND ]---------------------------------------------
#
   $template->assign_vars(array(
      'USERNAME' => $username,
      'CUR_PASSWORD' => $cur_password,
      'NEW_PASSWORD' => $new_password,
      'PASSWORD_CONFIRM' => $password_confirm,
      'EMAIL' => $email,
#
#-----[ AFTER, ADD ]--------------------------------------
#
      //signature editor
      'SIG_EDIT_LINK' => append_sid("profile.$phpEx?mode=signature"),
      'SIG_DESC' => $lang['sig_description'],
      'SIG_BUTTON_DESC' => $lang['sig_edit'],
      //signature editor

#
#-----[ OPEN ]---------------------------------------------
#
templates/xxx/profil_add_body.tpl

#
#-----[ FIND ]---------------------------------------------
#
   <tr>
     <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
     <td class="row2">
      <textarea name="signature"style="width: 300px"  rows="6" cols="30" class="post">{SIGNATURE}</textarea>
     </td>
   </tr>

#
#-----[ REPLACE WITH ]---------------------------------------
#
   <tr>
     <td class="row1"><span class="gen">{SIG_DESC}:</span></span></td>
     <td class="row2"><INPUT TYPE="button" VALUE="{SIG_BUTTON_DESC}" onclick="window.location.href='{SIG_EDIT_LINK}'"></td>
   </tr>

#
#-----[ SAVE AND CLOSE ALL FILES ]------------------------------------------ 